{extend name="base" /} {block name="body"}
<div class="layui-body">
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li  {if $status==1} class="layui-this" {/if}>
				<a href="{:url('porder/index',['status'=>1])}">带确认订单</a>
			</li>
			<li  {if $status==2} class="layui-this" {/if}>
				<a href="{:url('porder/index',['status'=>2])}">已确认订单</a>
			</li>
		</ul>
		<div class="layui-tab-content">
			<form action="" method="post" class="ajax-form">
				<div class="layui-tab-item layui-show">
					<table class="layui-table">
						<thead>
							<tr>
								<th style="width: 15px;"><input type="checkbox" class="check-all"></th>
								<th>购买用户</th>
								<th>商品名</th>
								<th>购买数量</th>
								<th>支付总价</th>
								<th>下单时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{foreach name="article_list" item="vo"}
							<tr id="tr_{$vo.id}">
								<td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
								<td>{$vo.uid}</td>
								<td>{$vo.pname}</td>
								<td>{$vo.num}</td>
								<td>{$vo.total_price}</td>
								<td>{$vo.add_time}</td>
								<td>
									{if $vo.status==1}
									<a href="#" onclick="queren('{$vo.id}')" >确认</a>
									{/if}
									
								</td>
							</tr>
							{/foreach}
						</tbody>
					</table>
				</div>
			</form>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script >
		function queren(id){
			layer.confirm("确认操作?", function() {
				$.ajax({
					type:"post",
					url: "{:url('porder/confirm')}",
					data:{
						id:id
					},
					success:function(data){
						layer.msg(data.msg);
						if(data.code==200){
							$("#tr_"+id).remove();
						}
					}
				});
			});
		}
</script>
{/block}
